package model

import (
	"gorm.io/gorm"
	"time"
)

type Online struct {
	Id        uint           `gorm:"column:id;type:bigint(20);primaryKey;not null;" json:"id"`
	UserId    uint           `gorm:"column:user_id;type:bigint(20) UNSIGNED;comment:用户Id;not null;" json:"user_id"` // 用户Id
	Title     string         `gorm:"column:title;type:varchar(255);comment:电商名称;not null;" json:"title"`            // 电商名称
	Desc      string         `gorm:"column:desc;type:varchar(255);comment:电商描述;not null;" json:"desc"`              // 电商描述
	Price     string         `gorm:"column:price;type:varchar(255);comment:电商价格;not null;" json:"price"`            // 电商价格
	Inventory string         `gorm:"column:inventory;type:varchar(255);comment:电商库存;not null;" json:"inventory"`    // 电商库存
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (o *Online) TableName() string {
	return "online"
}
